import request from '@/utils/request'

/**
 * 获取月卡列表
 * @param {*} params 参数
 * @returns 
 */
export function getCardListAPI(params) {
  return request({
    url: '/parking/card/list',
    method: 'get',
    params
  })
}

/**
 * 添加月卡
 * @param {*} data 
 * @returns 
 */
export function addCardAPI(data) {
  return request({
    url: '/parking/card',
    method: 'post',
    data
  })
}

/**
 * 获取月卡详情
 * @param {*} id  月卡id
 * @returns 
 */
export function getCardDetailAPI(id) {
  return request({
    url: `/parking/card/detail/${id}`,
    method: 'get'
  })
}

/**
 * 编辑月卡
 * @param {*} data   编辑月卡所需要的参数
 * @returns 
 */
export function editCardAPI(data) {
  return request({
    url: '/parking/card/edit',
    method: 'put',
    data
  })
}

/**
 * 删除月卡
 * @param {*} id  月卡id
 * @returns 
 */
export function deleteCardAPI(id){
   return request({
    url:`/parking/card/${id}`,
    method:'delete',
   })
}